import instance from "./requery";


// 用户登录
export const loginapp = (data:any) =>{
    return instance({
        method:'POST',
        url:'/user/login',
        data
    })
}

// 用户注册的方法
export const registerapp = (data) => {
  return instance({
    method: 'POST',
    url: '/user/registered',
    data
  })
}



// 发布房源
export const publishHouse = (data: any, token: string) => {
  return instance({
    method: 'POST',
    url: '/user/houses',
    headers: {
      'authorization': token
    },
    data
  })
}

// 根据小区关键字查询小区
export const queryCommunity = (name: string, cityId: string) => {
  return instance({
    method: 'GET',
    url: '/area/community',
    params: {
      name,
      id: cityId
    }
  })
}